<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
  <th:block th:include="include :: header('完善项目信息')" />
</head>
<body>
<div class="ibox-content">
  <div class="nav-tabs-custom">
    <ul class="nav nav-tabs">
      <li><a th:href="@{'/project/projectInfo/edit/'+${projectId}}" aria-expanded="false">基本信息</a></li>
      <li><a th:href="@{'/project/projectFlow/edit/'+${projectId}}" aria-expanded="false">工艺处理流程</a></li>
      <li><a th:href="@{'/project/projectFlowParam/'+${projectId}}" aria-expanded="false">工艺处理流程参数</a></li>
      <li><a th:href="@{'/project/projectTech/edit/'+${projectId}}" aria-expanded="false">工艺运行情况</a></li>
      <li><a th:href="@{'/project/projectEqp/edit/'+${projectId}}" aria-expanded="false">设备运行情况</a></li>
      <li><a th:href="@{'/project/projectWater/edit/'+${projectId}}" aria-expanded="false">水质指标情况</a></li>
      <li><a th:href="@{'/project/projectMicro/edit/'+${projectId}}" aria-expanded="false">菌剂使用情况</a></li>
      <li class="active"><a th:href="@{'/project/projectPharm/edit/'+${projectId}}" aria-expanded="true">药剂使用情况</a></li>
    </ul>
    <div class="tab-content">
      <div class="tab-pane active">
        <form class="form-horizontal m" id="form-projectPharm-edit" th:object="${projectPharm}">
          <input name="pharmId" th:field="*{pharmId}"  type="hidden">
          <input name="projectId" th:field="*{projectId}" type="hidden">
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">碳源种类：</label>
                <div class="col-sm-7">
                  <select name="carbonType" class="form-control m-b">
                    <option value="">无</option>
                    <option th:each="m:${csList}" th:value="${m.microbialId}" th:field="*{carbonType}" th:text="${m.microbialName}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">使用位点：</label>
                <div class="col-sm-7">
                  <select name="carbonPoint" class="form-control">
                    <option value="">无</option>
                    <option th:each="sf:${sfList}" th:value="${sf.flowId}" th:field="*{carbonPoint}"
                            th:text="${sf.flowName}"></option>
                  </select>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总剂量：</label>
                <div class="col-sm-7">
                  <div class="input-group">
                    <input name="carbonDosage" class="form-control digits" type="text" th:field="*{carbonDosage}" maxlength="8">
                    <span class="input-group-addon"><i class="fa">kg</i></span>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总次数：</label>
                <div class="col-sm-7">
                  <input name="carbonCount" class="form-control digits" type="text" th:field="*{carbonCount}" maxlength="2">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-12">
              <div class="form-group">
                <label class="col-sm-2 control-label">使用描述：</label>
                <div class="col-sm-10">
                  <input name="carbonIntro" class="form-control" type="text" th:field="*{carbonIntro}" maxlength="100">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">磷源种类：</label>
                <div class="col-sm-7">
                  <select name="phosType" class="form-control m-b">
                    <option value="">无</option>
                    <option th:each="m:${phosList}" th:value="${m.microbialId}" th:field="*{phosType}" th:text="${m.microbialName}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">使用位点：</label>
                <div class="col-sm-7">
                  <select name="phosPoint" class="form-control">
                    <option value="">无</option>
                    <option th:each="sf:${sfList}" th:value="${sf.flowId}" th:field="*{phosPoint}"
                            th:text="${sf.flowName}"></option>
                  </select>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总剂量：</label>
                <div class="col-sm-7">
                  <div class="input-group">
                    <input name="phosDosage" class="form-control digits" type="text" th:field="*{phosDosage}" maxlength="8">
                    <span class="input-group-addon"><i class="fa">kg</i></span>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总次数：</label>
                <div class="col-sm-7">
                  <input name="phosCount" class="form-control digits" type="text" th:field="*{phosCount}" maxlength="2">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-12">
              <div class="form-group">
                <label class="col-sm-2 control-label">使用描述：</label>
                <div class="col-sm-10">
                  <input name="phosIntro" class="form-control" type="text" th:field="*{phosIntro}" maxlength="100">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">絮凝剂种类1：</label>
                <div class="col-sm-7">
                  <select name="flocType1" class="form-control m-b">
                    <option value="">无</option>
                    <option th:each="m:${flocList}" th:value="${m.microbialId}" th:field="*{flocType1}" th:text="${m.microbialName}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">使用位点：</label>
                <div class="col-sm-7">
                  <select name="flocPoint1" class="form-control">
                    <option value="">无</option>
                    <option th:each="sf:${sfList}" th:value="${sf.flowId}" th:field="*{flocPoint1}"
                            th:text="${sf.flowName}"></option>
                  </select>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总剂量：</label>
                <div class="col-sm-7">
                  <div class="input-group">
                    <input name="flocDosage1" class="form-control digits" type="text" th:field="*{flocDosage1}" maxlength="8">
                    <span class="input-group-addon"><i class="fa">kg</i></span>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总次数：</label>
                <div class="col-sm-7">
                  <input name="flocCount1" class="form-control digits" type="text" th:field="*{flocCount1}" maxlength="2">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-12">
              <div class="form-group">
                <label class="col-sm-2 control-label">使用描述：</label>
                <div class="col-sm-10">
                  <input name="flocIntro1" class="form-control" type="text" th:field="*{flocIntro1}" maxlength="100">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">絮凝剂种类2：</label>
                <div class="col-sm-7">
                  <select name="flocType2" class="form-control m-b">
                    <option value="">无</option>
                    <option th:each="m:${flocList}" th:value="${m.microbialId}" th:field="*{flocType2}" th:text="${m.microbialName}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">使用位点：</label>
                <div class="col-sm-7">
                  <select name="flocPoint2" class="form-control">
                    <option value="">无</option>
                    <option th:each="sf:${sfList}" th:value="${sf.flowId}" th:field="*{flocPoint2}"
                            th:text="${sf.flowName}"></option>
                  </select>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总剂量：</label>
                <div class="col-sm-7">
                  <div class="input-group">
                    <input name="flocDosage2" class="form-control digits" type="text" th:field="*{flocDosage2}" maxlength="8">
                    <span class="input-group-addon"><i class="fa">kg</i></span>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总次数：</label>
                <div class="col-sm-7">
                  <input name="flocCount2" class="form-control digits" type="text" th:field="*{flocCount2}" maxlength="2">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-12">
              <div class="form-group">
                <label class="col-sm-2 control-label">使用描述：</label>
                <div class="col-sm-10">
                  <input name="flocIntro2" class="form-control" type="text" th:field="*{flocIntro2}" maxlength="100">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">强氧化剂种类：</label>
                <div class="col-sm-7">
                  <select name="oxidType" class="form-control m-b">
                    <option value="">无</option>
                    <option th:each="m:${oxidList}" th:value="${m.microbialId}" th:field="*{oxidType}" th:text="${m.microbialName}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">使用位点：</label>
                <div class="col-sm-7">
                  <select name="oxidPoint" class="form-control">
                    <option value="">无</option>
                    <option th:each="sf:${sfList}" th:value="${sf.flowId}" th:field="*{oxidPoint}"
                            th:text="${sf.flowName}"></option>
                  </select>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总剂量：</label>
                <div class="col-sm-7">
                  <div class="input-group">
                    <input name="oxidDosage" class="form-control digits" type="text" maxlength="8">
                    <span class="input-group-addon"><i class="fa">kg</i></span>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总次数：</label>
                <div class="col-sm-7">
                  <input name="oxidCount" class="form-control digits" type="text" maxlength="2">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-12">
              <div class="form-group">
                <label class="col-sm-2 control-label">使用描述：</label>
                <div class="col-sm-10">
                  <input name="oxidIntro" class="form-control" type="text" th:field="*{oxidIntro}" maxlength="100">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">其他药剂种类：</label>
                <div class="col-sm-7">
                  <select name="otherType" class="form-control m-b">
                    <option value="">无</option>
                    <option th:each="m:${otherList}" th:value="${m.microbialId}" th:field="*{otherType}"
                            th:text="${m.microbialName}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">使用位点：</label>
                <div class="col-sm-7">
                  <select name="otherPoint" class="form-control">
                    <option value="">无</option>
                    <option th:each="sf:${sfList}" th:value="${sf.flowId}" th:field="*{otherPoint}"
                            th:text="${sf.flowName}"></option>
                  </select>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总剂量：</label>
                <div class="col-sm-7">
                  <div class="input-group">
                    <input name="otherDosage" class="form-control digits" type="text" th:field="*{otherDosage}" maxlength="8">
                    <span class="input-group-addon"><i class="fa">kg</i></span>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-sm-6">
              <div class="form-group">
                <label class="col-sm-5 control-label">总次数：</label>
                <div class="col-sm-7">
                  <input name="otherCount" class="form-control digits" type="text" th:field="*{otherCount}" maxlength="2">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-12">
              <div class="form-group">
                <label class="col-sm-2 control-label">使用描述：</label>
                <div class="col-sm-10">
                  <input name="otherIntro" class="form-control" type="text" th:field="*{otherIntro}" maxlength="100">
                </div>
              </div>
            </div>
          </div>
        </form>
      </div>
      <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
          <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
          <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
      </div>
    </div>
  </div>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
  var prefix = ctx + "project/projectPharm";
  $("#form-projectPharm-edit").validate({
    focusCleanup: true
  });

  function submitHandler() {
    if ($.validate.form()) {
      var data = $("#form-projectPharm-edit").serializeArray();
      $.ajax({
        url: prefix + "/edit",
        type: "post",
        dataType: "json",
        data: data,
        success: function(result) {
          if (result.code == web_status.SUCCESS) {
            layer.msg(result.msg, { icon: $.modal.icon(modal_status.SUCCESS), time: 1000},function() {
              location.reload();
            });
          } else if (result.code == web_status.WARNING) {
            $.modal.msgWarning(result.msg)
          } else {
            $.modal.msgError(result.msg);
          }
          $.modal.closeLoading();
        }
      });
    }
  }
</script>
</body>
</html>